#ifndef HOME_H
#define HOME_H

#include <QDialog>
#include "mybtn.h"
#include "globalval.h"
#include <QUdpSocket>
#include <QTcpSocket>
#include <QHostAddress>
#include <QTextStream>
#include <QByteArray>
#include <QDebug>
#include <QStringList>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonDocument>
#include <QHostInfo>
#include <QFileDialog>
#include <QMessageBox>
#include <QFileInfo>
#include <QTimer>
#include <QPainter>
struct shuju
{
   QString flag;
   QString file_name;
   int file_len;
};

struct data
{
    int type;
    int result;
    int up_config;
    struct shuju sj;
};

namespace Ui {
class Home;
}

class Home : public QDialog
{
    Q_OBJECT

public:
    explicit Home(QWidget *parent = 0);
    QUdpSocket *usocket;
    QTcpSocket *tsocket;
    QJsonObject json;
    struct data da;
   void xinxijiaohu();
    QTimer *heartbeatTimer;
    QTimer *responseTimer;
    ~Home();

private:
    Ui::Home *ui;
//    void paintEvent(QPaintEvent * event);

private slots:
    void udpconnect();
    void tcpconnect();
    void udpread_data();
    void tcpread_data();
    void act(QString text);
    void sendHeartbeat();
    void onNoResponse();

signals:



};

#endif // HOME_H
